package com.pap.rbac.resource.auto.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.pap.base.mapper.PapBaseMapper;
import com.pap.rbac.agent.resource.dto.ResourceTreeNodeVO;
import com.pap.rbac.resource.auto.entity.Resource;;

public interface ResourceMapper extends PapBaseMapper<Resource> {
	int deleteByPrimaryKey(String id);

	int selectCountByMap(Map<Object, Object> map);

	List<Resource> selectListByMap(Map<Object, Object> map);

	Resource selectByPrimaryKeyAndTableName(@Param("id") String id, @Param("dynamicTableName") String dynamicTableName);

	int deleteByPrimaryKeyAndTableName(@Param("id") String id, @Param("dynamicTableName") String dynamicTableName);

	int insert(Resource record);

	int insertSelective(Resource record);

	Resource selectByPrimaryKey(String id);

	int updateByPrimaryKeySelective(Resource record);

	int updateByPrimaryKey(Resource record);
	
	// add alexgaoyh

	List<ResourceTreeNodeVO> resourceTreeJson(@Param("clientLicenseId") String clientLicenseId,
			@Param("globalParentId") String globalParentId);
	
	/**
	 * 查询当前登录下的所有资源集合
	 * @param userId	登录用户的主键编码
	 * @param clientLicenseId	全局统一的默认顶层组织架构的编码为 -1
	 * @return
	 */
	List<Resource> selectListByUserAndLicense(@Param("userId") String userId, @Param("clientLicenseId") String clientLicenseId);
}